package action;

public class PeriodicAction extends Action<Float> {

	@Override
	Float update() {
		if (internalTime >= time) {
			finished = true;
			internalTime = 0;
		}
		else // this if else will reset automatically the angle when it gives a full turn (360 degrees)
		{	 // it will also send a true whenever it completes the turn.
			finished = false;
		}
		return input + (target * (float)Math.sin(2 * Math.PI * (internalTime / time)));
	}

}
